This error occurs when trying to create a view from SQL DDL. The following would generate this error: CREATE VIEW viewname AS. To avoid the error, use a valid SELECT statement after the AS keyword.